//
//  options.cpp
//  utilities
//
//  Created by Sam Jaffe on 8/18/14.
//  Copyright (c) 2014 Sam Jaffe. All rights reserved.
//

#include <iostream>
#include "options.hpp"

#define getthree(x) std::get<0>(x) << " " << std::get<1>(x) << " " << std::get<2>(x)

struct testing : public options::options_base {
public:
    testing() {
        options::parser<testing>::addopt("h", hello, "The handshake string to send to recieve a login prompt for the desired user");
        options::parser<testing>::addopt("t", tup, "The x, y, and z positions of the first datapoint to consider");
        options::parser<testing>::addopt({"--g", "G", "goodbye="}, goodbye, "The signal indicating 'no more data'");
        options::parser<testing>::addopt("v", options::make_vargs_parser<testing>(vector), "A list of symbols to use as reference", {"string..."});
    }
    
    std::string hello;
    int goodbye;
    std::tuple<int, int, int> tup;
    std::vector<std::string> vector;
};

int main(int argc, const char* argv[]) {
    options::parser<testing>::parse_options(argc, argv);
    std::cout << "Hello is:   " << options::parser<testing>::value().hello << std::endl;
    std::cout << "Goodbye is: " << options::parser<testing>::value().goodbye << std::endl;
    std::cout << "Tuple is:   " << getthree(options::parser<testing>::value().tup) << std::endl;
    if (!options::parser<testing>::args().empty())
    std::cout << "Verb is:    " << options::parser<testing>::args().front() << std::endl;
    exit(EXIT_SUCCESS);
}

// (opts..., desc) =>
//  opt/opt/... <type> : desc
//